import json


def read_json(path):
    try:
        with open(path, 'r') as f:
            content = json.load(f)
        return content
    except Exception as e:
        print('读取失败：', e)
        return {}


def write_json(path, content):
    try:
        with open(path, 'w') as f:
            json.dump(content, f, indent=4)
        print('写入成功')
    except Exception as e:
        print('写入失败：', e)
